<html>
<head>
	<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
	<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
	<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
</head>
<body>
<script type="text/javascript">
$(document).ready(function() {
    $("a.toggle").toggle(function(){
        $(this).text($(this).text().replace(/隐藏/,'显示'));
        var a=$(this).parents(".summary");
        a.find(".inherited").hide();
    },function(){
        $(this).text($(this).text().replace(/显示/,'隐藏'));
        $(this).parents(".summary").find(".inherited").show();
    });
});
</script>


   <!-- 左侧栏 -->
	<div class="container">
	<div class="row">
    <div id="subpage_sidebar" class="left apidoc-classes-index span3">

      

<h3>包 core</h3>

<ul>
    <li>
    <a href="./class-q.html" title="Q">Q</a>
  </li>
    <li>
    <a href="./class-qexception.html" title="QException">QException</a>
  </li>
    <li>
    <a href="./class-qcoll.html" title="QColl">QColl</a>
  </li>
    <li>
    <a href="./class-qcontext.html" title="QContext">QContext</a>
  </li>
    <li>
    <a href="./class-qlog.html" title="QLog">QLog</a>
  </li>
  
</ul>


<h3>包 mvc</h3>

<ul>
    <li>
    <a href="./class-qacl.html" title="QACL">QACL</a>
  </li>
    <li>
    <a href="./class-qcontroller-abstract.html" title="QController_Abstract">QController_Abstract</a>
  </li>
    <li>
    <a href="./class-qcontroller-forward.html" title="QController_Forward">QController_Forward</a>
  </li>
    <li>
    <a href="./class-qrouter.html" title="QRouter">QRouter</a>
  </li>
    <li>
    <a href="./class-qview-output.html" title="QView_Output">QView_Output</a>
  </li>
    <li>
    <a href="./class-qview-redirect.html" title="QView_Redirect">QView_Redirect</a>
  </li>
    <li>
    <a href="./class-qview-render-php.html" title="QView_Render_PHP">QView_Render_PHP</a>
  </li>
    <li>
    <a href="./class-qview-render-php-parser.html" title="QView_Render_PHP_Parser">QView_Render_PHP_Parser</a>
  </li>
  
</ul>


<h3>包 orm</h3>

<ul>
    <li>
    <a href="./class-qdb-activerecord-behavior-abstract.html" title="QDB_ActiveRecord_Behavior_Abstract">QDB_ActiveRecord_Behavior_Abst...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-abstract.html" title="QDB_ActiveRecord_Abstract">QDB_ActiveRecord_Abstract</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-association-abstract.html" title="QDB_ActiveRecord_Association_Abstract">QDB_ActiveRecord_Association_A...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-association-belongsto.html" title="QDB_ActiveRecord_Association_BelongsTo">QDB_ActiveRecord_Association_B...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-association-coll.html" title="QDB_ActiveRecord_Association_Coll">QDB_ActiveRecord_Association_C...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-association-hasmany.html" title="QDB_ActiveRecord_Association_HasMany">QDB_ActiveRecord_Association_H...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-association-hasone.html" title="QDB_ActiveRecord_Association_HasOne">QDB_ActiveRecord_Association_H...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-association-manytomany.html" title="QDB_ActiveRecord_Association_ManyToMany">QDB_ActiveRecord_Association_M...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-meta.html" title="QDB_ActiveRecord_Meta">QDB_ActiveRecord_Meta</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-view.html" title="QDB_ActiveRecord_View">QDB_ActiveRecord_View</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-viewmeta.html" title="QDB_ActiveRecord_ViewMeta">QDB_ActiveRecord_ViewMeta</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-callbacks.html" title="QDB_ActiveRecord_Callbacks">QDB_ActiveRecord_Callbacks</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-interface.html" title="QDB_ActiveRecord_Interface">QDB_ActiveRecord_Interface</a>
  </li>
  
</ul>


<h3>包 form</h3>

<ul>
    <li>
    <a href="./class-qform-element.html" title="QForm_Element">QForm_Element</a>
  </li>
    <li>
    <a href="./class-qform-group.html" title="QForm_Group">QForm_Group</a>
  </li>
    <li>
    <a href="./class-qform.html" title="QForm">QForm</a>
  </li>
  
</ul>


<h3>包 database</h3>

<ul>
    <li>
    <a href="./class-qdb-adapter-abstract.html" title="QDB_Adapter_Abstract">QDB_Adapter_Abstract</a>
  </li>
    <li>
    <a href="./class-qdb-adapter-mysql.html" title="QDB_Adapter_Mysql">QDB_Adapter_Mysql</a>
  </li>
    <li>
    <a href="./class-qdb-adapter-pdo-abstract.html" title="QDB_Adapter_Pdo_Abstract">QDB_Adapter_Pdo_Abstract</a>
  </li>
    <li>
    <a href="./class-qdb-adapter-pdo-exception.html" title="QDB_Adapter_Pdo_Exception">QDB_Adapter_Pdo_Exception</a>
  </li>
    <li>
    <a href="./class-qdb-adapter-pdo-pgsql.html" title="QDB_Adapter_Pdo_Pgsql">QDB_Adapter_Pdo_Pgsql</a>
  </li>
    <li>
    <a href="./class-qdb-adapter-pgsql.html" title="QDB_Adapter_Pgsql">QDB_Adapter_Pgsql</a>
  </li>
    <li>
    <a href="./class-qdb-cond.html" title="QDB_Cond">QDB_Cond</a>
  </li>
    <li>
    <a href="./class-qdb.html" title="QDB">QDB</a>
  </li>
    <li>
    <a href="./class-qdb-expr.html" title="QDB_Expr">QDB_Expr</a>
  </li>
    <li>
    <a href="./class-qdb-result-abstract.html" title="QDB_Result_Abstract">QDB_Result_Abstract</a>
  </li>
    <li>
    <a href="./class-qdb-result-mysql.html" title="QDB_Result_Mysql">QDB_Result_Mysql</a>
  </li>
    <li>
    <a href="./class-qdb-result-pdo.html" title="QDB_Result_Pdo">QDB_Result_Pdo</a>
  </li>
    <li>
    <a href="./class-qdb-result-pgsql.html" title="QDB_Result_Pgsql">QDB_Result_Pgsql</a>
  </li>
    <li>
    <a href="./class-qdb-select.html" title="QDB_Select">QDB_Select</a>
  </li>
    <li>
    <a href="./class-qdb-table.html" title="QDB_Table">QDB_Table</a>
  </li>
    <li>
    <a href="./class-qdb-table-lite.html" title="QDB_Table_Lite">QDB_Table_Lite</a>
  </li>
  
</ul>


<h3>包 helper</h3>

<ul>
    <li>
    <a href="./class-helper-filesys.html" title="Helper_Filesys">Helper_Filesys</a>
  </li>
    <li>
    <a href="./class-helper-array.html" title="Helper_Array">Helper_Array</a>
  </li>
    <li>
    <a href="./class-qdom-document.html" title="QDom_Document">QDom_Document</a>
  </li>
    <li>
    <a href="./class-qdom-element.html" title="QDom_Element">QDom_Element</a>
  </li>
    <li>
    <a href="./class-qfilter.html" title="QFilter">QFilter</a>
  </li>
    <li>
    <a href="./class-helper-image.html" title="Helper_Image">Helper_Image</a>
  </li>
    <li>
    <a href="./class-helper-imagegd.html" title="Helper_ImageGD">Helper_ImageGD</a>
  </li>
    <li>
    <a href="./class-helper-imgcode.html" title="Helper_ImgCode">Helper_ImgCode</a>
  </li>
    <li>
    <a href="./class-helper-imgcodesimple.html" title="Helper_ImgCodeSimple">Helper_ImgCodeSimple</a>
  </li>
    <li>
    <a href="./class-helper-imgcodettf.html" title="Helper_ImgCodeTTF">Helper_ImgCodeTTF</a>
  </li>
    <li>
    <a href="./class-helper-uploader.html" title="Helper_Uploader">Helper_Uploader</a>
  </li>
    <li>
    <a href="./class-helper-uploader-file.html" title="Helper_Uploader_File">Helper_Uploader_File</a>
  </li>
    <li>
    <a href="./class-qvalidator.html" title="QValidator">QValidator</a>
  </li>
    <li>
    <a href="./class-helper-yaml.html" title="Helper_YAML">Helper_YAML</a>
  </li>
  
</ul>


<h3>包 cache</h3>

<ul>
    <li>
    <a href="./class-qcache-apc.html" title="QCache_APC">QCache_APC</a>
  </li>
    <li>
    <a href="./class-qcache-file.html" title="QCache_File">QCache_File</a>
  </li>
    <li>
    <a href="./class-qcache-memcached.html" title="QCache_Memcached">QCache_Memcached</a>
  </li>
    <li>
    <a href="./class-qcache-memory.html" title="QCache_Memory">QCache_Memory</a>
  </li>
    <li>
    <a href="./class-qcache-phpdatafile.html" title="QCache_PHPDataFile">QCache_PHPDataFile</a>
  </li>
    <li>
    <a href="./class-qcache-xcache.html" title="QCache_XCache">QCache_XCache</a>
  </li>
  
</ul>


<h3>包 webcontrols</h3>

<ul>
    <li>
    <a href="./class-qui-control-abstract.html" title="QUI_Control_Abstract">QUI_Control_Abstract</a>
  </li>
    <li>
    <a href="./class-control-input-abstract.html" title="Control_Input_Abstract">Control_Input_Abstract</a>
  </li>
    <li>
    <a href="./class-control-button.html" title="Control_Button">Control_Button</a>
  </li>
    <li>
    <a href="./class-control-checkbox-abstract.html" title="Control_Checkbox_Abstract">Control_Checkbox_Abstract</a>
  </li>
    <li>
    <a href="./class-control-checkbox.html" title="Control_Checkbox">Control_Checkbox</a>
  </li>
    <li>
    <a href="./class-control-checkboxgroup-abstract.html" title="Control_CheckboxGroup_Abstract">Control_CheckboxGroup_Abstract</a>
  </li>
    <li>
    <a href="./class-control-checkboxgroup.html" title="Control_CheckboxGroup">Control_CheckboxGroup</a>
  </li>
    <li>
    <a href="./class-control-dropdownlist.html" title="Control_DropdownList">Control_DropdownList</a>
  </li>
    <li>
    <a href="./class-control-hidden.html" title="Control_Hidden">Control_Hidden</a>
  </li>
    <li>
    <a href="./class-control-label.html" title="Control_Label">Control_Label</a>
  </li>
    <li>
    <a href="./class-control-listbox.html" title="Control_Listbox">Control_Listbox</a>
  </li>
    <li>
    <a href="./class-control-memo.html" title="Control_Memo">Control_Memo</a>
  </li>
    <li>
    <a href="./class-control-password.html" title="Control_Password">Control_Password</a>
  </li>
    <li>
    <a href="./class-control-radio.html" title="Control_Radio">Control_Radio</a>
  </li>
    <li>
    <a href="./class-control-radiogroup.html" title="Control_RadioGroup">Control_RadioGroup</a>
  </li>
    <li>
    <a href="./class-control-reset.html" title="Control_Reset">Control_Reset</a>
  </li>
    <li>
    <a href="./class-control-static.html" title="Control_Static">Control_Static</a>
  </li>
    <li>
    <a href="./class-control-submit.html" title="Control_Submit">Control_Submit</a>
  </li>
    <li>
    <a href="./class-control-textbox.html" title="Control_Textbox">Control_Textbox</a>
  </li>
    <li>
    <a href="./class-control-upload.html" title="Control_Upload">Control_Upload</a>
  </li>
  
</ul>


<h3>包 behavior</h3>

<ul>
    <li>
    <a href="./class-model-behavior-acluser.html" title="Model_Behavior_AclUser">Model_Behavior_AclUser</a>
  </li>
    <li>
    <a href="./class-model-behavior-fastuuid.html" title="Model_Behavior_Fastuuid">Model_Behavior_Fastuuid</a>
  </li>
    <li>
    <a href="./class-model-behavior-relation.html" title="Model_Behavior_Relation">Model_Behavior_Relation</a>
  </li>
    <li>
    <a href="./class-model-behavior-uniqueness.html" title="Model_Behavior_Uniqueness">Model_Behavior_Uniqueness</a>
  </li>
  
</ul>


<h3>包 exception</h3>

<ul>
    <li>
    <a href="./class-qcache-exception.html" title="QCache_Exception">QCache_Exception</a>
  </li>
    <li>
    <a href="./class-q-classfileexistsexception.html" title="Q_ClassFileExistsException">Q_ClassFileExistsException</a>
  </li>
    <li>
    <a href="./class-q-classnotdefinedexception.html" title="Q_ClassNotDefinedException">Q_ClassNotDefinedException</a>
  </li>
    <li>
    <a href="./class-q-createdirfailedexception.html" title="Q_CreateDirFailedException">Q_CreateDirFailedException</a>
  </li>
    <li>
    <a href="./class-q-createfilefailedexception.html" title="Q_CreateFileFailedException">Q_CreateFileFailedException</a>
  </li>
    <li>
    <a href="./class-q-filenotfoundexception.html" title="Q_FileNotFoundException">Q_FileNotFoundException</a>
  </li>
    <li>
    <a href="./class-q-filenotreadableexception.html" title="Q_FileNotReadableException">Q_FileNotReadableException</a>
  </li>
    <li>
    <a href="./class-q-illegalclassnameexception.html" title="Q_IllegalClassNameException">Q_IllegalClassNameException</a>
  </li>
    <li>
    <a href="./class-q-illegalfilenameexception.html" title="Q_IllegalFilenameException">Q_IllegalFilenameException</a>
  </li>
    <li>
    <a href="./class-qlog-exception.html" title="QLog_Exception">QLog_Exception</a>
  </li>
    <li>
    <a href="./class-q-notimplementedexception.html" title="Q_NotImplementedException">Q_NotImplementedException</a>
  </li>
    <li>
    <a href="./class-q-removedirfailedexception.html" title="Q_RemoveDirFailedException">Q_RemoveDirFailedException</a>
  </li>
    <li>
    <a href="./class-qdb-exception.html" title="QDB_Exception">QDB_Exception</a>
  </li>
    <li>
    <a href="./class-qdb-exception-duplicatekey.html" title="QDB_Exception_DuplicateKey">QDB_Exception_DuplicateKey</a>
  </li>
    <li>
    <a href="./class-qdb-select-exception.html" title="QDB_Select_Exception">QDB_Select_Exception</a>
  </li>
    <li>
    <a href="./class-qdb-table-exception.html" title="QDB_Table_Exception">QDB_Table_Exception</a>
  </li>
    <li>
    <a href="./class-acluser-exception.html" title="AclUser_Exception">AclUser_Exception</a>
  </li>
    <li>
    <a href="./class-acluser-duplicateusernameexception.html" title="AclUser_DuplicateUsernameException">AclUser_DuplicateUsernameExcep...</a>
  </li>
    <li>
    <a href="./class-acluser-usernamenotfoundexception.html" title="AclUser_UsernameNotFoundException">AclUser_UsernameNotFoundExcept...</a>
  </li>
    <li>
    <a href="./class-acluser-wrongpasswordexception.html" title="AclUser_WrongPasswordException">AclUser_WrongPasswordException</a>
  </li>
    <li>
    <a href="./class-qform-exception.html" title="QForm_Exception">QForm_Exception</a>
  </li>
    <li>
    <a href="./class-qdom-exception.html" title="QDom_Exception">QDom_Exception</a>
  </li>
    <li>
    <a href="./class-qvalidator-exception.html" title="QValidator_Exception">QValidator_Exception</a>
  </li>
    <li>
    <a href="./class-qvalidator-validatefailedexception.html" title="QValidator_ValidateFailedException">QValidator_ValidateFailedExcep...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-association-exception.html" title="QDB_ActiveRecord_Association_Exception">QDB_ActiveRecord_Association_E...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-association-notdefinedexception.html" title="QDB_ActiveRecord_Association_NotDefinedException">QDB_ActiveRecord_Association_N...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-association-rejectexception.html" title="QDB_ActiveRecord_Association_RejectException">QDB_ActiveRecord_Association_R...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-behavior-exception.html" title="QDB_ActiveRecord_Behavior_Exception">QDB_ActiveRecord_Behavior_Exce...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-exception.html" title="QDB_ActiveRecord_Exception">QDB_ActiveRecord_Exception</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-calltoundefinedmethodexception.html" title="QDB_ActiveRecord_CallToUndefinedMethodException">QDB_ActiveRecord_CallToUndefin...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-changingreadonlypropexception.html" title="QDB_ActiveRecord_ChangingReadonlyPropException">QDB_ActiveRecord_ChangingReado...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-compositepkincompatibleexception.html" title="QDB_ActiveRecord_CompositePKIncompatibleException">QDB_ActiveRecord_CompositePKIn...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-destroywithoutidexception.html" title="QDB_ActiveRecord_DestroyWithoutIdException">QDB_ActiveRecord_DestroyWithou...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-expectsassocpropexception.html" title="QDB_ActiveRecord_ExpectsAssocPropException">QDB_ActiveRecord_ExpectsAssocP...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-meta-exception.html" title="QDB_ActiveRecord_Meta_Exception">QDB_ActiveRecord_Meta_Exceptio...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-settingproptypemismatchexception.html" title="QDB_ActiveRecord_SettingPropTypeMismatchException">QDB_ActiveRecord_SettingPropTy...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-undefinedpropexception.html" title="QDB_ActiveRecord_UndefinedPropException">QDB_ActiveRecord_UndefinedProp...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-validatefailedexception.html" title="QDB_ActiveRecord_ValidateFailedException">QDB_ActiveRecord_ValidateFaile...</a>
  </li>
    <li>
    <a href="./class-qacl-exception.html" title="QACL_Exception">QACL_Exception</a>
  </li>
    <li>
    <a href="./class-qrouter-exception.html" title="QRouter_Exception">QRouter_Exception</a>
  </li>
    <li>
    <a href="./class-qrouter-invalidrouteexception.html" title="QRouter_InvalidRouteException">QRouter_InvalidRouteException</a>
  </li>
    <li>
    <a href="./class-qrouter-routenotfoundexception.html" title="QRouter_RouteNotFoundException">QRouter_RouteNotFoundException</a>
  </li>
    <li>
    <a href="./class-qview-exception.html" title="QView_Exception">QView_Exception</a>
  </li>
    <li>
    <a href="./class-qui-exception.html" title="QUI_Exception">QUI_Exception</a>
  </li>
  
</ul>


<h3>包 debug</h3>

<ul>
    <li>
    <a href="./class-qdebug.html" title="QDebug">QDebug</a>
  </li>
    <li>
    <a href="./class-qdebug-firephp.html" title="QDebug_FirePHP">QDebug_FirePHP</a>
  </li>
  
</ul>



    </div>

    <!-- /左侧栏 -->

    <!-- 右侧栏 -->

    <div id="col3" class="right contents span9">

      
<div class="apidoc-class">

  <h1>类 - Model_Behavior_AclUser</h1>

  <ul class="nav nav-tabs">
    <li class="active"><a href="./index.html">所有包</a></li>

        <li><a href="#properties">类属性</a></li>
    
        <li><a href="#methods">类方法</a></li>
    

  </ul>

  
<table class="summary-table table table-bordered" cellpadding="0" cellspacing="0" >
  <tr>
    <th nowrap="nowrap">包</th>
    <td>behavior</td>
  </tr>
  <tr>
    <th nowrap="nowrap">类层次</th>
    <td>
    Model_Behavior_AclUser
&raquo;
<a href="./class-qdb-activerecord-behavior-abstract.html">QDB_ActiveRecord_Behavior_Abstract</a>
    </td>
  </tr>

    <tr>
    <th nowrap="nowrap">实现的接口</th>
    <td></td>
  </tr>
  
  
    <tr>
    <th nowrap="nowrap">版本</th>
    <td>$Id: acluser.php 2423 2009-04-21 19:59:40Z dualface $</td>
  </tr>
  
</table>

<div class="formatted">
  
<p>Behavior_AclUser 实现基于 ACL 的用户访问控制</p>

<p>acluser 行为插件支持下列设置选项：</p>

<ul>
	<li>encode_type: 密码的加密方式，默认值为 crypt。
		<p>该选项可以设置为 cleartext,
		md5、crypt、sha1、sha2，或任何有效的 PHP
		全局函数名。其中，cleartext 表示不加密密码。</p>

		<p>如果要使用自定义的加密方法，可以指定 encode_type
		设置为一个回调函数，例如：</p>

		<pre class="php code"><span class="st_h">'encode_type'</span> <span
		class="sy0">=&gt;</span> <span class="kw3">array</span><span
		class="br0">&#40;</span><span class="st_h">'MyClass'</span><span
		class="sy0">,</span> <span class="st_h">'encryptString'</span><span
		class="br0">&#41;</span><span class="sy0">;</span></pre>
	</li>

	<li>username_prop:
	指示在模型中使用哪一个属性来保存的用户名，默认值为
	username。
		<p>由于 acluser
		插件需要通过用户名来查询对象，因此需要指定正确的属性名称。</p>
	</li>

	<li>password_prop:
	指示在模型中使用哪一个属性来保存用户密码，默认值为
	password。
		<p>acluser
		插件在验证用户登录、更新密码时需要用到该设置指定的属性。</p>
	</li>

	<li>roles_enabled: 是否启用对关联角色的支持，默认值为 false。
		<p>当启用关联角色支持后，可以通过 aclRoles()
		方法来获得用户对象关联的角色信息。</p>

		<p>关联角色支持需要设置下列选项：</p>

		<ul>
			<li>roles_prop:
			角色信息映射到用户模型的哪一个属性之上。默认值为
			roles。</li>

			<li>roles_name_prop:
			指示角色模型使用哪一个属性保存角色名称，默认值为
			name。</li>
		</ul>
	</li>

	<li>acl_data_props: 指示在使用 aclData()
	方法时，返回的数组中要包含哪些属性。
		<p>默认值为 uesrname。</p>

		<p>要指定多个属性，用“,”分割，例如“username,
		email”。不过不管指定什么属性，</p>

		<p>aclData() 方法返回的数组中总是包含一个名为 id
		的键，其键值是用户的 ID。</p>
	</li>

	<li>update_login_auto: 是否在成功调用 validateLogin()
	后自动更新用户信息，默认值为 false。
		<p>当 update_login_auto 为 true 时，可以指定下列选项：</p>

		<ul>
			<li>update_login_count_prop:
			记录登录次数的属性，不指定则不更新；</li>

			<li>update_login_at_prop:
			记录登录时间的属性，不指定则不更新</li>

			<li>update_login_ip_prop: 记录登录 IP 的属性，不指定则不更新</li>
		</ul>
	</li>

	<li>register_save_auto:
	是否在新建用户对象时，自动保存下列信息，默认值为
	false。
		<ul>
			<li>register_ip_prop: 记录用户注册时的 IP 地址</li>

			<li>register_at_prop: 记录注册时间</li>
		</ul>
	</li>

	<li>unique_username: 指示是否检查用户名的唯一性，默认值为
	true。
		<p>当该设置为 true 时，将不允许创建同名用户。</p>

		<p>并在尝试创建同名用户时抛出 AclUser_DuplicateUsernameException
		异常。</p>
	</li>
</ul>
</div>


  <a name="properties"></a>

  
<div class="summary">

  <h2>保护的属性</h2>
  <p>
    <a href="#" class="toggle">隐藏继承的属性</a>
  </p>

  <table class="list-table table table-bordered">
    <tr>
      <th>属性</th><th>类型</th><th>描述</th><th>定义于</th>
    </tr>

    
    <tr>
      <td>$_settings</td>
      <td>array</td>
      <td>插件的设置信息</td>
      <td>
      	<small>
                Model_Behavior_AclUser        		</small>
      </td>
    </tr>
    
    <tr class="inherited">
      <td>$_meta</td>
      <td>QDB_ActiveRecord_Meta</td>
      <td>ActiveRecord 继承类的元信息对象</td>
      <td>
      	<small>
                <a href="./class-qdb-activerecord-behavior-abstract.html">QDB_ActiveRecord_Behavior_Abstract</a>
        		</small>
      </td>
    </tr>
    
  </table>
</div>



  <a name="methods"></a>
  
<div class="summary">
  <h2>公共方法</h2>
  <p>
    <a href="#" class="toggle">隐藏继承的方法</a>
  </p>

  <table class="list-table table table-bordered">
    <tr>
      <th>方法</th><th>描述</th><th>定义于</th>
    </tr>

        <tr>
      <td>
        <a href="#Model_Behavior_AclUser_bind">bind()</a>
      </td>

      <td>绑定行为插件</td>
      <td>
                Model_Behavior_AclUser        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#Model_Behavior_AclUser_validateLogin">validateLogin()</a>
      </td>

      <td>验证用户登录并返回用户对象</td>
      <td>
                Model_Behavior_AclUser        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#Model_Behavior_AclUser_validateUsername">validateUsername()</a>
      </td>

      <td>验证用户名</td>
      <td>
                Model_Behavior_AclUser        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#Model_Behavior_AclUser_validatePassword">validatePassword()</a>
      </td>

      <td>验证用户名和密码</td>
      <td>
                Model_Behavior_AclUser        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#Model_Behavior_AclUser_changePassword">changePassword()</a>
      </td>

      <td>修改指定用户的密码</td>
      <td>
                Model_Behavior_AclUser        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#Model_Behavior_AclUser_checkPasswordDyn">checkPasswordDyn()</a>
      </td>

      <td>检查指定的密码是否与当前用户的密码相符</td>
      <td>
                Model_Behavior_AclUser        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#Model_Behavior_AclUser_changePasswordDyn">changePasswordDyn()</a>
      </td>

      <td>修改当前用户的密码</td>
      <td>
                Model_Behavior_AclUser        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#Model_Behavior_AclUser_updateLoginDyn">updateLoginDyn()</a>
      </td>

      <td>更新用户的登录信息</td>
      <td>
                Model_Behavior_AclUser        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#Model_Behavior_AclUser_aclRolesDyn">aclRolesDyn()</a>
      </td>

      <td>获得包含用户所有角色名的数组</td>
      <td>
                Model_Behavior_AclUser        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#Model_Behavior_AclUser_aclDataDyn">aclDataDyn()</a>
      </td>

      <td>获得用户的 ACL 数据</td>
      <td>
                Model_Behavior_AclUser        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#Model_Behavior_AclUser__after_validate_on_create">_after_validate_on_create()</a>
      </td>

      <td>在新建的 ActiveRecord 保存到数据库前调用的事件</td>
      <td>
                Model_Behavior_AclUser        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#Model_Behavior_AclUser__after_validate_on_update">_after_validate_on_update()</a>
      </td>

      <td>在更新 ActiveRecord 前调用的事件</td>
      <td>
                Model_Behavior_AclUser        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#Model_Behavior_AclUser__save_exception_handler">_save_exception_handler()</a>
      </td>

      <td>在保存新建用户对象失败抛出异常时，还原用户的密码属性</td>
      <td>
                Model_Behavior_AclUser        
      </td>
    </tr>
        <tr class="inherited">
      <td>
        <a href="./class-qdb-activerecord-behavior-abstract.html#QDB_ActiveRecord_Behavior_Abstract___construct">__construct()</a>
      </td>

      <td>构造函数</td>
      <td>
                <a href="./class-qdb-activerecord-behavior-abstract.html">QDB_ActiveRecord_Behavior_Abstract</a>
        
      </td>
    </tr>
        <tr class="inherited">
      <td>
        <a href="./class-qdb-activerecord-behavior-abstract.html#QDB_ActiveRecord_Behavior_Abstract_normalizeConfig">normalizeConfig()</a>
      </td>

      <td>格式化配置</td>
      <td>
                <a href="./class-qdb-activerecord-behavior-abstract.html">QDB_ActiveRecord_Behavior_Abstract</a>
        
      </td>
    </tr>
        <tr class="inherited">
      <td>
        <a href="./class-qdb-activerecord-behavior-abstract.html#QDB_ActiveRecord_Behavior_Abstract_unbind">unbind()</a>
      </td>

      <td>撤销行为插件绑定</td>
      <td>
                <a href="./class-qdb-activerecord-behavior-abstract.html">QDB_ActiveRecord_Behavior_Abstract</a>
        
      </td>
    </tr>
    
  </table>
</div>



<div class="summary">
  <h2>保护的方法</h2>
  <p>
    <a href="#" class="toggle">隐藏继承的方法</a>
  </p>

  <table class="list-table table table-bordered">
    <tr>
      <th>方法</th><th>描述</th><th>定义于</th>
    </tr>

        <tr class="inherited">
      <td>
        <a href="./class-qdb-activerecord-behavior-abstract.html#QDB_ActiveRecord_Behavior_Abstract__addDynamicMethod">_addDynamicMethod()</a>
      </td>

      <td>为 ActiveRecord 对象添加一个动态方法</td>
      <td>
                <a href="./class-qdb-activerecord-behavior-abstract.html">QDB_ActiveRecord_Behavior_Abstract</a>
        
      </td>
    </tr>
        <tr class="inherited">
      <td>
        <a href="./class-qdb-activerecord-behavior-abstract.html#QDB_ActiveRecord_Behavior_Abstract__addStaticMethod">_addStaticMethod()</a>
      </td>

      <td>为 ActiveRecord 类添加一个静态方法</td>
      <td>
                <a href="./class-qdb-activerecord-behavior-abstract.html">QDB_ActiveRecord_Behavior_Abstract</a>
        
      </td>
    </tr>
        <tr class="inherited">
      <td>
        <a href="./class-qdb-activerecord-behavior-abstract.html#QDB_ActiveRecord_Behavior_Abstract__addEventHandler">_addEventHandler()</a>
      </td>

      <td>为 ActiveRecord 对象添加一个事件处理函数</td>
      <td>
                <a href="./class-qdb-activerecord-behavior-abstract.html">QDB_ActiveRecord_Behavior_Abstract</a>
        
      </td>
    </tr>
        <tr class="inherited">
      <td>
        <a href="./class-qdb-activerecord-behavior-abstract.html#QDB_ActiveRecord_Behavior_Abstract__setPropGetter">_setPropGetter()</a>
      </td>

      <td>设置一个属性的 getter 方法</td>
      <td>
                <a href="./class-qdb-activerecord-behavior-abstract.html">QDB_ActiveRecord_Behavior_Abstract</a>
        
      </td>
    </tr>
        <tr class="inherited">
      <td>
        <a href="./class-qdb-activerecord-behavior-abstract.html#QDB_ActiveRecord_Behavior_Abstract__setPropSetter">_setPropSetter()</a>
      </td>

      <td>设置一个属性的 setter 方法</td>
      <td>
                <a href="./class-qdb-activerecord-behavior-abstract.html">QDB_ActiveRecord_Behavior_Abstract</a>
        
      </td>
    </tr>
    
  </table>
</div>



<div class="details">

  <h2>属性详细说明</h2>

    
  <a name="_settings"></a>

  <div class="name property">
    <strong>$_settings</strong>

    <span class="tags">属性</span>
  </div>

  <div class="signature">
      </div>

  <div class="formatted">
    
<p>插件的设置信息</p>
  </div>

    
  <a name="_saved_state"></a>

  <div class="name property">
    <strong>$_saved_state</strong>

    <span class="tags">属性</span>
  </div>

  <div class="signature">
      </div>

  <div class="formatted">
    
<p>保存状态</p>
  </div>

    
</div>


<div class="details">

  <h2>方法详细说明</h2>

    
  <a name="Model_Behavior_AclUser_bind"></a>

  <h4 class="name method">
    bind()
    <span class="tags">方法</span>
  </h4>
	<p>
	public void <strong>bind</strong>()	</p>
  <table class="list-table table table-bordered">

    
  </table>

  <div class="formatted">
    
<p>绑定行为插件</p>
  </div>
	<hr>
    
  <a name="Model_Behavior_AclUser_validateLogin"></a>

  <h4 class="name method">
    validateLogin()
    <span class="tags">方法</span>
  </h4>
	<p>
	public QDB_ActiveRecord_Abstract <strong>validateLogin</strong>($username, $password, $update_login)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$username</td>
      <td class="param_type">string</td>
      <td class="param_desc">用户名</td>
    </tr>
    
    <tr>
      <td class="param_name">$password</td>
      <td class="param_type">string</td>
      <td class="param_desc">密码</td>
    </tr>
    
    <tr>
      <td class="param_name">$update_login</td>
      <td class="param_type">boolean</td>
      <td class="param_desc">阻止自动更新</td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type">QDB_ActiveRecord_Abstract</td>
      <td class="param_desc">用户对象</td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>验证用户登录并返回用户对象</p>

<p>如果 update_login_auto 设置为
true，验证通过时会同时更新用户的登录信息。</p>

<p>用法：</p>

<pre class="php code">try
<span class="br0">&#123;</span>
    <span
class="re0">$member</span> <span class="sy0">=</span> Member<span
class="sy0">::</span><span class="me2">meta</span><span
class="br0">&#40;</span><span class="br0">&#41;</span><span
class="sy0">-&gt;</span><span class="me1">validateLogin</span><span
class="br0">&#40;</span><span class="re0">$username</span><span
class="sy0">,</span> <span class="re0">$password</span><span
class="br0">&#41;</span><span class="sy0">;</span>
    dump<span
class="br0">&#40;</span><span class="re0">$member</span><span
class="br0">&#41;</span><span class="sy0">;</span>
<span
class="br0">&#125;</span>
catch <span
class="br0">&#40;</span>AclUser_Exception <span class="re0">$ex</span><span
class="br0">&#41;</span>
<span class="br0">&#123;</span>
    <span
class="kw3">echo</span> <span class="re0">$ex</span><span
class="sy0">-&gt;</span><span class="me1">getMessage</span><span
class="br0">&#40;</span><span class="br0">&#41;</span><span
class="sy0">;</span>
<span class="br0">&#125;</span></pre>

<p>如果用户名不存在，将抛出 AclUser_UsernameNotFoundException
异常。 密码不正确，则抛出 AclUser_WrongPasswordException
异常。</p>
  </div>
	<hr>
    
  <a name="Model_Behavior_AclUser_validateUsername"></a>

  <h4 class="name method">
    validateUsername()
    <span class="tags">方法</span>
  </h4>
	<p>
	public boolean <strong>validateUsername</strong>($username)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$username</td>
      <td class="param_type">string</td>
      <td class="param_desc">用户名</td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type">boolean</td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>验证用户名</p>

<p>用法：</p>

<pre class="php code"><span class="kw1">if</span> <span
class="br0">&#40;</span>Member<span class="sy0">::</span><span
class="me2">meta</span><span class="br0">&#40;</span><span
class="br0">&#41;</span><span class="sy0">-&gt;</span><span
class="me1">validateUsername</span><span class="br0">&#40;</span><span
class="re0">$username</span><span class="br0">&#41;</span><span
class="br0">&#41;</span>
<span class="br0">&#123;</span>
    <span
class="kw3">echo</span> <span class="st_h">'用户名验证通过'</span><span
class="sy0">;</span>
<span class="br0">&#125;</span></pre>
  </div>
	<hr>
    
  <a name="Model_Behavior_AclUser_validatePassword"></a>

  <h4 class="name method">
    validatePassword()
    <span class="tags">方法</span>
  </h4>
	<p>
	public boolean <strong>validatePassword</strong>($username, $password)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$username</td>
      <td class="param_type">string</td>
      <td class="param_desc">用户名</td>
    </tr>
    
    <tr>
      <td class="param_name">$password</td>
      <td class="param_type">string</td>
      <td class="param_desc">密码</td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type">boolean</td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>验证用户名和密码</p>

<p>用法：</p>

<pre class="php code"><span class="kw1">if</span> <span
class="br0">&#40;</span>Member<span class="sy0">::</span><span
class="me2">meta</span><span class="br0">&#40;</span><span
class="br0">&#41;</span><span class="sy0">-&gt;</span><span
class="me1">validatePassword</span><span class="br0">&#40;</span><span
class="re0">$username</span><span class="sy0">,</span> <span
class="re0">$password</span><span class="br0">&#41;</span><span
class="br0">&#41;</span>
<span class="br0">&#123;</span>
    <span
class="kw3">echo</span> <span
class="st_h">'用户名和密码验证通过'</span><span
class="sy0">;</span>
<span class="br0">&#125;</span></pre>
  </div>
	<hr>
    
  <a name="Model_Behavior_AclUser_changePassword"></a>

  <h4 class="name method">
    changePassword()
    <span class="tags">方法</span>
  </h4>
	<p>
	public void <strong>changePassword</strong>($username, $new_password, $old_password, $ignore_old_password)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$username</td>
      <td class="param_type">string</td>
      <td class="param_desc">用户名</td>
    </tr>
    
    <tr>
      <td class="param_name">$new_password</td>
      <td class="param_type">string</td>
      <td class="param_desc">新密码</td>
    </tr>
    
    <tr>
      <td class="param_name">$old_password</td>
      <td class="param_type">string</td>
      <td class="param_desc">旧密码</td>
    </tr>
    
    <tr>
      <td class="param_name">$ignore_old_password</td>
      <td class="param_type">boolean</td>
      <td class="param_desc">是否忽略对旧密码的检查，默认为 false</td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type"></td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>修改指定用户的密码</p>

<p>用法：</p>

<pre class="php code">Member<span class="sy0">::</span><span
class="me2">changePassword</span><span class="br0">&#40;</span><span
class="re0">$username</span><span class="sy0">,</span> <span
class="re0">$new_password</span><span class="sy0">,</span> <span
class="re0">$old_password</span><span class="br0">&#41;</span><span
class="sy0">;</span></pre>

<p>如果用户名不存在，则抛出 AclUser_UsernameNotFoundException
异常。 如果旧密码不正确，则抛出 AclUser_WrongPasswordException
异常。</p>

<p>可以通过指定 $ignore_old_password 为 true
来忽略对旧密码的检查：</p>

<pre class="php code">Member<span class="sy0">::</span><span
class="me2">changePassword</span><span class="br0">&#40;</span><span
class="re0">$username</span><span class="sy0">,</span> <span
class="re0">$new_password</span><span class="sy0">,</span> <span
class="kw2">null</span><span class="sy0">,</span> <span
class="kw2">true</span><span class="br0">&#41;</span><span
class="sy0">;</span></pre>
  </div>
	<hr>
    
  <a name="Model_Behavior_AclUser_checkPasswordDyn"></a>

  <h4 class="name method">
    checkPasswordDyn()
    <span class="tags">方法</span>
  </h4>
	<p>
	public boolean <strong>checkPasswordDyn</strong>($member, $password)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$member</td>
      <td class="param_type">QDB_ActiveRecord_Abstract</td>
      <td class="param_desc">要检查的用户对象</td>
    </tr>
    
    <tr>
      <td class="param_name">$password</td>
      <td class="param_type">string</td>
      <td class="param_desc">检查密码</td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type">boolean</td>
      <td class="param_desc">检查结果</td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>检查指定的密码是否与当前用户的密码相符</p>

<p>用法：</p>

<pre class="php code"><span class="kw1">if</span> <span
class="br0">&#40;</span><span class="re0">$member</span><span
class="sy0">-&gt;</span><span class="me1">checkPassword</span><span
class="br0">&#40;</span><span class="re0">$password</span><span
class="br0">&#41;</span>
<span class="br0">&#123;</span>
    <span
class="kw3">echo</span> <span
class="st_h">'指定的密码与用户现有的密码相符'</span><span
class="sy0">;</span>
<span class="br0">&#125;</span></pre>
  </div>
	<hr>
    
  <a name="Model_Behavior_AclUser_changePasswordDyn"></a>

  <h4 class="name method">
    changePasswordDyn()
    <span class="tags">方法</span>
  </h4>
	<p>
	public void <strong>changePasswordDyn</strong>($member, $new_password, $old_password, $ignore_old_password)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$member</td>
      <td class="param_type">QDB_ActiveRecord_Abstract</td>
      <td class="param_desc">要更新密码的用户对象</td>
    </tr>
    
    <tr>
      <td class="param_name">$new_password</td>
      <td class="param_type">string</td>
      <td class="param_desc">新密码</td>
    </tr>
    
    <tr>
      <td class="param_name">$old_password</td>
      <td class="param_type">string</td>
      <td class="param_desc">旧密码</td>
    </tr>
    
    <tr>
      <td class="param_name">$ignore_old_password</td>
      <td class="param_type">boolean</td>
      <td class="param_desc">是否忽略对旧密码的检查，默认为 false</td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type"></td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>修改当前用户的密码</p>

<p>用法：</p>

<pre class="php code">try
<span class="br0">&#123;</span>
    <span
class="re0">$member</span><span class="sy0">-&gt;</span><span
class="me1">changePassword</span><span class="br0">&#40;</span><span
class="re0">$new_password</span><span class="sy0">,</span> <span
class="re0">$old_password</span><span class="br0">&#41;</span><span
class="sy0">;</span>
    <span class="kw3">echo</span> <span
class="st_h">'修改密码成功'</span><span class="sy0">;</span>
<span
class="br0">&#125;</span>
catch <span
class="br0">&#40;</span>AclUser_Exception <span class="re0">$ex</span><span
class="br0">&#41;</span>
<span class="br0">&#123;</span>
    <span
class="kw3">echo</span> <span class="re0">$ex</span><span
class="sy0">-&gt;</span><span class="me1">getMessage</span><span
class="br0">&#40;</span><span class="br0">&#41;</span><span
class="sy0">;</span>
<span class="br0">&#125;</span></pre>

<p>如果旧密码不正确，则抛出 AclUser_WrongPasswordException
异常。</p>

<p>可以通过指定 $ignore_old_password 为 true
来忽略对旧密码的检查：</p>

<pre class="php code"><span class="re0">$member</span><span
class="sy0">-&gt;</span><span class="me1">changePassword</span><span
class="br0">&#40;</span><span class="re0">$new_password</span><span
class="sy0">,</span> <span class="kw2">null</span><span
class="sy0">,</span> <span class="kw2">true</span><span
class="br0">&#41;</span><span class="sy0">;</span></pre>
  </div>
	<hr>
    
  <a name="Model_Behavior_AclUser_updateLoginDyn"></a>

  <h4 class="name method">
    updateLoginDyn()
    <span class="tags">方法</span>
  </h4>
	<p>
	public void <strong>updateLoginDyn</strong>($member, $data)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$member</td>
      <td class="param_type">QDB_ActiveRecord_Abstract</td>
      <td class="param_desc">要更新登录信息的用户对象</td>
    </tr>
    
    <tr>
      <td class="param_name">$data</td>
      <td class="param_type">array</td>
      <td class="param_desc">自行指定的属性值</td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type"></td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>更新用户的登录信息</p>

<p>要更新的属性由 update_login_count_prop、update_login_at_prop 和
update_login_ip_prop 设置指定。</p>

<p>用法：</p>

<pre class="php code"><span class="re0">$member</span><span
class="sy0">-&gt;</span><span class="me1">updateLogin</span><span
class="br0">&#40;</span><span class="br0">&#41;</span><span
class="sy0">;</span></pre>

<p>updateLogin() 会尝试自行获取登录时间和 IP
信息。如果有必要也可自行指定：</p>

<pre class="php code"><span class="re0">$member</span><span
class="sy0">-&gt;</span><span class="me1">updateLogin</span><span
class="br0">&#40;</span><span class="kw3">array</span><span
class="br0">&#40;</span>
    <span class="st_h">'login_at'</span> <span
class="sy0">=&gt;</span> <span class="re0">$time</span><span
class="sy0">,</span>
    <span class="st_h">'login_ip'</span> <span
class="sy0">=&gt;</span> <span class="re0">$ip</span><span
class="sy0">,</span>
<span class="br0">&#41;</span><span
class="br0">&#41;</span><span class="sy0">;</span></pre>
  </div>
	<hr>
    
  <a name="Model_Behavior_AclUser_aclRolesDyn"></a>

  <h4 class="name method">
    aclRolesDyn()
    <span class="tags">方法</span>
  </h4>
	<p>
	public array <strong>aclRolesDyn</strong>($member)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$member</td>
      <td class="param_type">QDB_ActiveRecord_Abstract</td>
      <td class="param_desc">用户对象</td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type">array</td>
      <td class="param_desc">包含角色名的数组</td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>获得包含用户所有角色名的数组</p>

<p>用法：</p>

<pre class="php code"><span class="re0">$roles</span> <span
class="sy0">=</span> <span class="re0">$member</span><span
class="sy0">-&gt;</span><span class="me1">aclRoles</span><span
class="br0">&#40;</span><span class="br0">&#41;</span><span
class="sy0">;</span>
<span class="kw3">echo</span> <span
class="st_h">'用户具有下列角色： '</span> <span
class="sy0">.</span> <span class="kw3">implode</span><span
class="br0">&#40;</span><span class="st_h">', '</span><span
class="sy0">,</span> <span class="re0">$roles</span><span
class="br0">&#41;</span><span class="sy0">;</span></pre>
  </div>
	<hr>
    
  <a name="Model_Behavior_AclUser_aclDataDyn"></a>

  <h4 class="name method">
    aclDataDyn()
    <span class="tags">方法</span>
  </h4>
	<p>
	public array <strong>aclDataDyn</strong>($member, $props)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$member</td>
      <td class="param_type">QDB_ActiveRecord_Abstract</td>
      <td class="param_desc">用户对象</td>
    </tr>
    
    <tr>
      <td class="param_name">$props</td>
      <td class="param_type">string</td>
      <td class="param_desc">要返回的属性值</td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type">array</td>
      <td class="param_desc">包含指定属性值的数组</td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>获得用户的 ACL 数据</p>

<p>ACL 数据一般包含用户 ID 和用户名，通常用于配合 QACL
实现基于角色的访问控制。</p>

<p>用法：</p>

<pre class="php code"><span class="re0">$data</span> <span
class="sy0">=</span> <span class="re0">$member</span><span
class="sy0">-&gt;</span><span class="me1">aclData</span><span
class="br0">&#40;</span><span class="br0">&#41;</span><span
class="sy0">;</span>
dump<span class="br0">&#40;</span><span
class="re0">$data</span><span class="br0">&#41;</span><span
class="sy0">;</span></pre>

<p>要返回的数据由 acl_data_props
设置来指定。不过不管指定了哪些属性，aclData()
的返回结果中总是为包含名为 id
的键。该键的值是用户对象的 ID。</p>

<p>也可以在获得 ACL 数据时通过 $props
参数指定要返回的属性值：</p>

<pre class="php code"><span class="re0">$data</span> <span
class="sy0">=</span> <span class="re0">$member</span><span
class="sy0">-&gt;</span><span class="me1">aclData</span><span
class="br0">&#40;</span><span class="st_h">'email, addr'</span><span
class="br0">&#41;</span><span class="sy0">;</span></pre>
  </div>
	<hr>
    
  <a name="Model_Behavior_AclUser__after_validate_on_create"></a>

  <h4 class="name method">
    _after_validate_on_create()
    <span class="tags">方法</span>
  </h4>
	<p>
	public void <strong>_after_validate_on_create</strong>($member)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$member</td>
      <td class="param_type">QDB_ActiveRecord_Abstract</td>
      <td class="param_desc">用户对象</td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type"></td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>在新建的 ActiveRecord 保存到数据库前调用的事件</p>
  </div>
	<hr>
    
  <a name="Model_Behavior_AclUser__after_validate_on_update"></a>

  <h4 class="name method">
    _after_validate_on_update()
    <span class="tags">方法</span>
  </h4>
	<p>
	public void <strong>_after_validate_on_update</strong>($member)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$member</td>
      <td class="param_type">QDB_ActiveRecord_Abstract</td>
      <td class="param_desc">用户对象</td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type"></td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>在更新 ActiveRecord 前调用的事件</p>
  </div>
	<hr>
    
  <a name="Model_Behavior_AclUser__save_exception_handler"></a>

  <h4 class="name method">
    _save_exception_handler()
    <span class="tags">方法</span>
  </h4>
	<p>
	public void <strong>_save_exception_handler</strong>($member, $ex)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$member</td>
      <td class="param_type">QDB_ActiveRecord_Abstract</td>
      <td class="param_desc">保存出错的用户对象</td>
    </tr>
    
    <tr>
      <td class="param_name">$ex</td>
      <td class="param_type">Exception</td>
      <td class="param_desc">异常</td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type"></td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>在保存新建用户对象失败抛出异常时，还原用户的密码属性</p>
  </div>
	<hr>
                      
</div>


</div>


    </div>

    <!-- /右侧栏 -->
    </div>
	</div>
</body>
</html>
